<!DOCTYPE HTML>
<html>
	<head>
		<?php
			include_once 'manage_db/db_connect.php';
			include_once 'manage_users/add_user.php';
			session_start();
			$username=$_SESSION['username'];
			$con = db_connect();
		;?>
		<title><?php echo $username." | Add User";?></title>
	</head>
	<body>
		<?php include_once 'html_elements/header.php';?>
		<h1>Add User</h1>
		<p>
		<form action="" method="post">
			Username : <input name="username" type="text"/>
			<br>
			Password  : <input name="passwd" type="password"/> 
			<br>
			<input type="submit" value="register user" name="submit"/>
			<?php 
				if(isset($_POST['submit'])){
					if(add_user($_POST['username'],$_POST['passwd'])){
						echo "<br>Username ".$_POST['username']." registered";
					}else{
						echo("<br>Username taken.");
					}
				}
			;?>
		</form>
		<a href="manage_users.php">Back</a>
		</p>
	</body>
	</font>
</html>